import { defineStore } from "pinia";

interface store {
  num: number;
}

export const useTestStore = defineStore({
  id: "test",
  state: (): store => {
    return {
      num: 0,
    };
  },
  getters: {
    double: (state) => {
      return state.num * 2;
    },
  },
  actions: {
    increment(num = 1) {
      this.$state.num += num;
    },
  },
});
